package com.audio;

import android.app.Activity;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MediaPlayerActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Button myButton = (Button)findViewById(R.id.playsong);
        myButton.setOnClickListener(new Button.OnClickListener(){

			@Override
			public void onClick(View v) {
				MediaPlayer mp = MediaPlayer.create(MediaPlayerActivity.this, R.raw.halotheme);
				mp.start();
				mp.setOnCompletionListener(new OnCompletionListener() {
					
					@Override
					public void onCompletion(MediaPlayer arg0) {
					}
				});
			}        	
        });
    }
}